package com.mcp.converter.domain.converter;

import com.mcp.converter.shared.enums.IncompatibilityType;

/**
 * 转换详情类
 * 记录SQL转换的详细信息
 */
public class ConversionDetail {
    
    /**
     * 转换类型
     */
    private IncompatibilityType type;
    
    /**
     * 原始内容
     */
    private String original;
    
    /**
     * 转换后内容
     */
    private String converted;
    
    /**
     * 转换原因
     */
    private String reason;
    
    /**
     * 转换位置
     */
    private Position position;
    
    /**
     * 位置类
     */
    public static class Position {
        private int line;
        private int column;
        private int startIndex;
        private int endIndex;
        
        public Position(int line, int column, int startIndex, int endIndex) {
            this.line = line;
            this.column = column;
            this.startIndex = startIndex;
            this.endIndex = endIndex;
        }
        
        public int getLine() {
            return line;
        }
        
        public void setLine(int line) {
            this.line = line;
        }
        
        public int getColumn() {
            return column;
        }
        
        public void setColumn(int column) {
            this.column = column;
        }
        
        public int getStartIndex() {
            return startIndex;
        }
        
        public void setStartIndex(int startIndex) {
            this.startIndex = startIndex;
        }
        
        public int getEndIndex() {
            return endIndex;
        }
        
        public void setEndIndex(int endIndex) {
            this.endIndex = endIndex;
        }
    }
    
    public ConversionDetail() {
    }
    
    public ConversionDetail(IncompatibilityType type, String original, String converted) {
        this.type = type;
        this.original = original;
        this.converted = converted;
    }
    
    public ConversionDetail(IncompatibilityType type, String original, String converted, String reason) {
        this(type, original, converted);
        this.reason = reason;
    }
    
    public IncompatibilityType getType() {
        return type;
    }
    
    public void setType(IncompatibilityType type) {
        this.type = type;
    }
    
    public String getOriginal() {
        return original;
    }
    
    public void setOriginal(String original) {
        this.original = original;
    }
    
    public String getConverted() {
        return converted;
    }
    
    public void setConverted(String converted) {
        this.converted = converted;
    }
    
    public String getReason() {
        return reason;
    }
    
    public void setReason(String reason) {
        this.reason = reason;
    }
    
    public Position getPosition() {
        return position;
    }
    
    public void setPosition(Position position) {
        this.position = position;
    }
}
